package com.softer.wxzj.entity;

import com.softer.wxzj.entity.base.BaseEntity;
import com.softer.wxzj.entity.base.FieldMeta;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
public class BaseHouseInfo extends BaseEntity implements Comparable<BaseHouseInfo> {
    private BigDecimal fundAmount;
    private BigDecimal totalAmount;
    @FieldMeta(name = "id")
    private String id;
    private BigDecimal dueAmount;
    private String oldValue;
    @FieldMeta(name = "depType")
    private String depType;
    @FieldMeta(name = "houseAddress")
    private String houseAddress;
    @FieldMeta(name = "dicName")
    private String dicName;
    @FieldMeta(name = "expNum")
    private String expNum;
    /**
     * 房屋座落
     */
    @FieldMeta(name = "房屋座落")
    private String houseSite;
    /**
     * 房屋座落
     */
    @FieldMeta(name = "房屋座落")
    private String houseCity;
    private String newOwnerId;
    private String newOwnerNo;
    private String newOwnerName;
    private String newCertNo;
    /**
     * 楼幢编码
     */
    @FieldMeta(name = "楼幢编码")
    private String buildNo;

    /**
     * 单元编码
     */
    @FieldMeta(name = "单元编码")
    private String cellNo;
    /**
     * 单元id
     */
    @FieldMeta(name = "单元id")
    private String cellId;
    /**
     * 楼层号
     */
    @FieldMeta(name = "楼层号")
    private String floorNo;
    /**
     * 房间号
     */
    @FieldMeta(name = "房间号")
    private String roomNo;
    /**
     * 房屋性质
     */
    @FieldMeta(name = "房屋类型 ")
    private String houseAttr;
    /**
     *
     */
    @FieldMeta(name = "房屋性质")
    private String houseUse;
    @FieldMeta(name = "房屋性质")
    private String houseUseName;
    /**
     *
     */
    @FieldMeta(name = "建筑面积")
    private BigDecimal struArea;
    /**
     *
     */
    @FieldMeta(name = "附属面积")
    private BigDecimal annexeArea;
    /**
     *
     */
    @FieldMeta(name = "备注")
    private String remark;
    /**
     *
     */
    @FieldMeta(name = "是否地下层")
    private String isUnder;
    /**
     *
     */
    @FieldMeta(name = "房间名称")
    private String roomName;
    /**
     *
     */
    @FieldMeta(name = "分户代码")
    private String accNo;
    /**
     *
     */
    @FieldMeta(name = "银行编号")
    private String bankCode;
    private String bankName;
    private String bankAcc;
    private String accName;
    /**
     *
     */
    @FieldMeta(name = "状态")
    private String state;
    /**
     *
     */
    @FieldMeta(name = "初交模式")
    private String firstMode;
    @FieldMeta(name = "初交模式")
    private String firstModeName;
    /**
     *
     */
    @FieldMeta(name = "证件类型")
    private String certType;
    /**
     *
     */
    @FieldMeta(name = "房屋售价")
    private BigDecimal price;
    /**
     *
     */
    @FieldMeta(name = "初缴应缴")
    private BigDecimal firstDue;
    /**
     *
     */
    @FieldMeta(name = "当前资金本金余额")
    private BigDecimal fundBal;
    /**
     *
     */
    @FieldMeta(name = "当前利息余额")
    private BigDecimal accrBal;
    /**
     * 当前账户余额（本金+利息）
     */
    private BigDecimal accrFundBal;
    /**
     * 当前账户可用余额（本金+利息-冻结金额）
     */
    private BigDecimal accrAvailableBal;
    /**
     *
     */
    @FieldMeta(name = "计息日期")
    private String rateDate;
    /**
     *
     */
    @FieldMeta(name = "在用利率")
    private BigDecimal atRate;
    /**
     *
     */
    @FieldMeta(name = "结息类型")
    private Integer rateType;
    /**
     *
     */
    @FieldMeta(name = "账户状态")
    private Integer accState;
    /**
     * 购房日期
     */
    @FieldMeta(name = "购房日期")
    private String purchaseDate;
    /**
     * 支用申请状态 0待申请 1审核中  2审核通过
     */
    @FieldMeta(name = "支用申请状态")
    private String applyState;
    /**
     * 缴存状态 1足额 2多缴 3少缴 4未交 5免交
     */
    @FieldMeta(name = "交存状态")
    private String dueState;
    /**
     * 交存申请状态（0待申请 1审核中  2审核通过 （缴存中）3审核失败，4正常（缴存结束））
     */
    @FieldMeta(name = "支用申请状态")
    private String dueApplyState;
    /**
     * 业主账号
     */
    @FieldMeta(name = "业主账号")
    private String ownerNo;
    /**
     * 业主名称
     */
    @FieldMeta(name = "业主名称")
    private String ownerName;
    /**
     * 业主名称
     */
    @FieldMeta(name = "业主id")
    private String ownerId;

    /**
     * 是否绑定业主  0否  1是
     */
    @FieldMeta(name = "是否绑定业主")
    private String ownerState;
    /**
     * 业主名
     */
    @FieldMeta(name = "业主名")
    private String name;
    /**
     * 合同备案时间
     */
    @FieldMeta(name = "合同备案时间")
    private String contractDate;
    /**
     * 证件号码
     */
    @FieldMeta(name = "证件号码")
    private String certNo;
    /**
     * 单元编码
     */
    @FieldMeta(name = "单元编码")
    private String cellName;

    /**
     * 房屋性质
     */
    @FieldMeta(name = "房屋类型")
    private String houseAttrName;
    /**
     * 小区编号
     */
    @FieldMeta(name = "小区编号")
    private String regionNo;
    @FieldMeta(name = "regionId")
    private String regionId;
    /**
     * 自然幢名称
     */
    @FieldMeta(name = "自然幢名称")
    private String buildName;
    /**
     * 自然幢编号（自然幢表）
     */
    @FieldMeta(name = "自然幢编号")
    private String baseBuildNo;
    /**
     * 是否可以变更
     */
    @FieldMeta(name = "是否可以变更")
    private String change;
    /**
     * 在途中的审核业务，0不存在在途业务，其他关联审核流程类型表，审核结束后改为0
     */
    @FieldMeta(name = "在途中的审核业务")
    private String flowInProgress;
    /**
     * 房屋地址
     */
    @FieldMeta(name = "房屋地址")
    private String address;
    /**
     * 房屋数
     */
    @FieldMeta(name = "num")
    private int num;
    /**
     * 账户冻结金额
     */
    @FieldMeta(name = "账户冻结本金金额")
    private BigDecimal accountFrozen;
    /**
     * 账户冻结金额
     */
    @FieldMeta(name = "账户冻结利息金额")
    private BigDecimal accountFrozenBal;
    /**
     * 账户冻结金额
     */
    @FieldMeta(name = "账户冻结金额(本金加利息)")
    private BigDecimal accountFrozenAll;
    /**
     * 金额
     */
    @FieldMeta(name = "金额")
    private BigDecimal payAmount;
    /**
     * 销户利息
     */
    @FieldMeta(name = "销户利息")
    private BigDecimal sellerInterest;
    /**
     * 联系电话
     */
    @FieldMeta(name = "联系电话")
    private String phone;
    /**
     * 购房合同
     */
    @FieldMeta(name = "购房合同")
    private String contractNo;
    /**
     * 在途业务名
     */
    @FieldMeta(name = "在途业务名")
    private String progressName;
    @FieldMeta(name = "银行名称")
    private String BankCodeName;
    @FieldMeta(name = "状态")
    private String flowState;
    /**
     * 交存申请的id
     */
    @FieldMeta(name = "qid")
    private String qid;
    @FieldMeta(name = "dueStateName")
    private String dueStateName;
    /**
     * 交存申请的state
     */
    @FieldMeta(name = "qstate")
    private String qstate;
    @FieldMeta(name = "step")
    private String step;
    /**
     * 交存维护的state
     */
    @FieldMeta(name = "lstate")
    private String lstate;
    /**
     * list de id
     */
    @FieldMeta(name = "lid")
    private String lid;
    @FieldMeta(name = "payOtherAmount")
    private BigDecimal payOtherAmount;
    @FieldMeta(name = "stateNo")
    private String stateNo;
    /**
     * 用于展示房屋不能调换的原因，也可以做他用
     */
    @FieldMeta(name = "msg")
    private String msg;
    /**
     * 主房id   当前房屋为附房时，添加主房id
     */
    @FieldMeta(name = "mainHouseId")
    private String mainHouseId;
    /**
     * 是否附房 1是  0否
     */
    @FieldMeta(name = "是否附房")
    private String isAffiliated;
    /**
     * 是否附房 1是  0否
     */
    @FieldMeta(name = "isDueState")
    private String isDueState;
    /**
     * 每层户数
     */
    @FieldMeta(name = "每层户数")
    private String houseNum;
    /**
     * 按什么交存
     */
    @FieldMeta(name = "每层户数")
    private String depyTypeName;
    /**
     * 房间名的最后两位数字
     */
    @FieldMeta(name = "houseNo")
    private Integer houseNo;
    /**
     * 房间名的最后两位数字
     */
    @FieldMeta(name = "cellType")
    private Integer cellType;
    @FieldMeta(name = "regionName")
    private String regionName;
    @FieldMeta(name = "subRegionName")
    private String subRegionName;
    @FieldMeta(name = "zoneName")
    private String zoneName;
    @FieldMeta(name = "maxRefAmount")
    private BigDecimal maxRefAmount;
    /**
     * 可用金额
     */
    @FieldMeta(name = "availableBal")
    private BigDecimal availableBal;
    @FieldMeta(name = "变更id")
    private String reqNo;
    @FieldMeta(name = "房屋id")
    private String businessNextId;
    @FieldMeta(name = "单元id")
    private String businessId;
    @FieldMeta(name = "缴存")
    private List<DepModeInfo> depModeInfos;
    @FieldMeta(name = "单元list")
    private List<BaseCellInfo> baseCellInfos;
    @FieldMeta(name = "notDueNumPer")
    private String notDueNumPer;
    @FieldMeta(name = "DueNumPer")
    private String DueNumPer;
    @FieldMeta(name = "quotaPer")
    private String quotaPer;
    @FieldMeta(name = "notQuotaPer")
    private String notQuotaPer;
    @FieldMeta(name = "notDueNum")
    private BigDecimal notDueNum;
    @FieldMeta(name = "dueNum")
    private BigDecimal dueNum;
    @FieldMeta(name = "quota")
    private BigDecimal quota;
    @FieldMeta(name = "notQuota")
    private BigDecimal notQuota;
    @FieldMeta(name = "acclAll")
    private BigDecimal acclAll;
    @FieldMeta(name = "expAll")
    private BigDecimal expAll;
    @FieldMeta(name = "dueAll")
    private BigDecimal dueAll;
    @FieldMeta(name = "reqAll")
    private BigDecimal reqAll;
    @FieldMeta(name = "createrTimeStart")
    private String createrTimeStart;
    @FieldMeta(name = "createrTimeEnd")
    private String createrTimeEnd;
    /**
     * 续交模式
     */
    private String modeType;
    /**
     * 续交模式名称
     */
    private String modeTypeName;
    /**
     * 推送状态
     */
    private String pushState;
    /**
     * 打印通知状态
     */
    private String noticeState;
    /**
     * 楼层性质
     */
    private String buildType;
    /**
     * 结构属性
     */
    private String buildAttr;
    /**
     * 申请提交时间
     */
    private String depDate;
    /**
     * 申请有效日期
     */
    private String validDate;
    /**
     * 图档信息
     */
    private List<FileVO> fileTypeList;
    /**
     * 退款ID
     */
    private String refId;
    /**
     * 有无电梯1有，0无
     */
    private String lift;
    /**
     * 续交比例
     */
    private BigDecimal rate;
    /**
     * 退款类型 225销户 226部分返还 227全额返还
     */
    private String refType;
    @Override
    public int compareTo(BaseHouseInfo o) {
        //先按照年龄排序
        int i = Integer.parseInt(this.getFloorNo()) - Integer.parseInt(o.getFloorNo());
        if (i == 0) {
            //如果年龄相等了再用分数进行排序
            return Integer.parseInt(this.getRoomNo()) - Integer.parseInt(o.getRoomNo());
        }
        return i;
    }
}
